package com.sky.service;

import com.sky.dto.*;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.vo.OrderPaymentVO;
import com.sky.vo.OrderStatisticsVO;
import com.sky.vo.OrderSubmitVO;
import com.sky.vo.OrderVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

public interface OrderService {
    /**
     * 用户下单
     * @param ordersSubmitDTO
     * @return
     */
    public Result<OrderSubmitVO> submitOrder(OrdersSubmitDTO ordersSubmitDTO);

    /**
     * 查看历史订单
     * @param page
     * @param pageSize
     * @param status
     * @return
     */
    public Result<PageResult> page(int page, int pageSize, Integer status);
    /**
     * 查询订单详情
     * @param id
     * @return
     */
    Result<OrderVO> details(Long id);
    /**
     * 用户取消订单
     *
     * @return
     */
    public Result cancel(Long id)throws Exception;
    /**
     * 再来一单
     *
     * @param id
     * @return
     */
    public Result repetition(Long id);
    /**
     * 订单搜索
     * @param ordersPageQueryDTO
     * @return
     */
    public Result<PageResult> conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO);
    /**
     * 各个状态的订单数量统计
     *
     * @return
     */
    public Result<OrderStatisticsVO> statistics();
    /**
     * 接单
     *
     * @return
     */
    public Result confirm(OrdersConfirmDTO ordersConfirmDTO);
    /**
     * 拒单
     *
     * @return
     */
    public Result rejection(OrdersRejectionDTO ordersRejectionDTO) throws Exception;
    /**
     * 取消订单
     *
     * @return
     */
    public Result cancel(OrdersCancelDTO ordersCancelDTO) throws Exception;
    /**
     * 派送订单
     *
     * @return
     */
    public Result delivery(Long id);
    /**
     * 完成订单
     *
     * @return
     */
    public Result complete(Long id);
    /**
     * 订单支付
     * @param ordersPaymentDTO
     * @return
     */
    OrderPaymentVO payment(OrdersPaymentDTO ordersPaymentDTO) throws Exception;

    /**
     * 支付成功，修改订单状态
     * @param outTradeNo
     */
    void paySuccess(String outTradeNo);
    /**
     * 用户催单
     *
     * @param id
     * @return
     */
    public Result reminder(Long id);
}
